import { Component, OnInit } from '@angular/core';
import { ServiceApis } from '../utils/service.apis';

@Component({
  selector: 'app-heroes',
  templateUrl: './heroes.component.html',
  styleUrls: ['./heroes.component.css'],
})
export class HeroesComponent implements OnInit {

  constructor(private ServiceApis: ServiceApis) {
  }
  // postList: any;
  private user: any;
  ngOnInit() {
    this.getFoods();
  }
  getFoods() {
    this.ServiceApis.getUserInfo().subscribe(
      // the first argument is a function which runs on success
      data => { this.user = data },
      // the second argument is a function which runs on error
      err => console.error(err),
      // the third argument is a function which runs on completion
      () => console.log('done loading foods')
    );
  }
  hexoes = 'ddd'
}
